package main

import (
	"github.com/google/wire"
	"jk-time/webook/interactive/cache"
	"jk-time/webook/interactive/dao"
	articleEvents "jk-time/webook/interactive/events"
	"jk-time/webook/interactive/grpc_service"
	"jk-time/webook/interactive/ioc"
	"jk-time/webook/interactive/repository"
	"jk-time/webook/interactive/service"
)

var thirdPartySet1 = wire.NewSet(
	//最基础第三方依赖
	ioc.InitSRC,
	ioc.InitDST,
	ioc.InitBizDB,
	ioc.InitDoubleWritePool,

	ioc.InitLogger,

	ioc.InitKafka,
	ioc.InitSyncProducer,
	articleEvents.NewInteractiveKafkaProducer,
	articleEvents.NewInteractiveKafkaComsumer,

	ioc.InitMigratorServer,
	ioc.InitInteractiveProducer,
	ioc.InitInteractiveConsumer,
	ioc.InitConsumer,
)
var interactiveSvcSet1 = wire.NewSet(
	ioc.InitRedis,
	dao.NewGormInteractiveDAO,
	cache.NewRedisInteractiveCache,
	repository.NewCacheInteractiveRepository,
	service.NewInteractiveService,
	grpc_service.NewInteractiveServiceServer,
	ioc.NewGrpcxServer,
)

func Init1() *App {
	wire.Build(
		thirdPartySet,
		interactiveSvcSet,
		wire.Struct(new(App), "*"),
	)
	return new(App)
}
